const router = require('koa-router')();
const examhistory = require('../modules/examhistory');

//获取数据
router.get('/userexamhistory',async (ctx,next) => {
    ctx.body = await examhistory.selectexamHistory();  
})
//增加数据
router.post('/userexamhistory',async (ctx,next) => {
    ctx.body = await examhistory.addexamHistory(ctx.request.body)
})
//删除数据
router.delete('/userexamhistory/:history_id/:history_title',async (ctx,next) => {
    ctx.body = await examhistory.deleteexamHistory(ctx.params);
})
//修改数据
router.put('/userexamhistory',async (ctx,next) => {
    ctx.body = await examhistory.putexamHistory(ctx.request.body)
})

module.exports = router;